<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>My JSP 'role_add.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
</head>

<body>
<script type="text/javascript">
    jQuery(function () {

        $('form[name="add"] input[name="roomName"]').validatebox({
            required: true,
            validType: 'length[2,30]',
            missingMessage: '请输入房间名',
            invalidMessage : '房间名长度为2-30 位'
        });

        $('form[name="add"] #hotelId').combobox({
           //mode: 'remote',
            editable :       false,
            required: true,
            invalidMessage: '请选择酒店',
            panelHeight: 'auto',
            url: 'hotelAction!getHotelName',
            method: 'post',
            valueField: 'hotelId',
            textField: 'hotelName'
        });

        $('form[name="add"] #roomType').combobox({
            //mode: 'remote',
            required: true,
            editable :       false,
            invalidMessage: '请选择房间类型',
            panelHeight: 'auto',
            url: 'roomAction!getRoomType',
            method: 'post',
            valueField: 'roomType',
            textField: 'roomType'
        });
    })


</script>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'west',split:true" style="width:280px;">
    <form id="add" name="add" enctype="multipart/form-data" style="margin:0;padding:5px 0 0 20px;color:#333;">
        <table border="0">
            <tr>
                <td>房间名称</td>
                <td><input type="text" class="textbox" name="roomName" id="roomName" value=""/></td>
            </tr>
            <tr>
                <td>房间价格</td>
                <td><input type="text" name="roomPay" id="roomPay"class="easyui-numberbox" precision="0"
                           max="99999" size="8" maxlength="8"  style="text-align:right; width: 160px"/></td>
            </tr>
            <tr>
                <td>房间类型</td>
                <td><input type="text" class="easyui-combobox" name="roomType" id="roomType" value=""/></td>
            </tr>
            <tr>
                <td>所属酒店</td>
                <td><input type="text" class="easyui-combobox" name="hotelId" id="hotelId" value=""/></td>
            </tr>
            <tr>
                <td>房间图片</td>
            </tr>
            <tr>
                <td colspan="2"><input  type="file" onchange="change_photo()" name="picture" id="picture"/></td>
            </tr>
            <tr>
                <td>房间描述</td>
                <td><textarea cols="20" rows="3" name="roomDesc" id="roomDesc" style="	border-radius: 5px;-moz-border-radius: 5px;
                -webkit-border-radius: 5px;"></textarea>
            </tr>
        </table>
    </form>
    </div>
    <div data-options="region:'center'" style="padding:10px">
        <div id="Imgdiv">
            <img id="Img" width="100%" height="250px"/>
        </div>
    </div>
</div>

</body>
</html>
